<?php
header("content-type:text/html;charset=utf8");
$id=$_GET['id'];
$dbh=new PDO('mysql:host=localhost;dbname=mhsw','root','root');
$sql="select * from news where id='$id'";
$arr=$dbh->query($sql)->fetch(PDO::FETCH_ASSOC);
?>
<form action="updatedo.php">
<table border="1">
    <tr>
        <td>新闻名称</td>
        <td><input type="text" name="news_name" value="<?php echo $arr['news_name']?>"></td>
    </tr>
    <tr>
        <td>新闻内容</td>
        <td><input type="text" name="news_content" value="<?php echo $arr['news_content']?>"></td>
    </tr>
    <tr>
        <td><input type="submit" value="修改"></td>
    </tr>
    <input type="hidden" name="hid" value="<?php echo $id?>">
</table>
</form>
